package me.zk.practice1.s;

/**
 * @author zhangkai
 * @date 2023/7/29 11:08
 */
public class LS24 {
    public ListNode swapPairs(ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        ListNode newHead = head.next;

        head.next = swapPairs(newHead.next);
        newHead.next = head;

        return newHead;
    }
}
